<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@include file="/header.jsp" %>

<body>
<div class="row" style="border:0px solid red">
    <div class="col-md-2">
        <div class="row">
            <ul class="list-group" id="left_cate">

                <c:forEach items="${category}" var="c">

                    <c:forEach items="${c}" var="cl">
                        <c:set value="${param.get('childid')}" var="chi"/>
                        <c:set value="${cl.cateId}" var="id"/>

                        <c:if test="${chi == id}">
                            <a href="${pageContext.request.contextPath}/goods/goodsCate.action?childid=${cl.cateId}"
                               class="list-group-item active">${cl.cateName}</a>
                        </c:if>

                        <c:if test="${chi != id}">
                            <a href="${pageContext.request.contextPath}/goods/goodsCate.action?childid=${cl.cateId}"
                               class="list-group-item">${cl.cateName}</a>
                        </c:if>
                    </c:forEach>
                </c:forEach>

            </ul>
        </div>
    </div>
    <div class="col-md-10">
        <div class="row">
            <c:set var="goods1" scope="request" value="${goods}"/>

            <c:if test="${goods1 == null}">
                <div style="display: flex; justify-content: center;">
                    <div class="alert alert-danger col-md-2" role="alert">对不起，暂无此类商品</div>
                </div>
            </c:if>

            <c:forEach items="${goods}" var="good">
                <div class="col-md-4">
                    <div class="thumbnail">
                        <div style="width:220px; height:172px; display:flex; justify-content:center; margin-left:40px">
                            <img width="148px" heigth="112px" alt="暂无图片"
                                 src="${pageContext.request.contextPath}${good.goodsPic}"/>
                        </div>
                        <div class="caption text-center">
                            <label>
                                    ${good.goodsName}
                            </label>

                            <h4 class="substr color">${good.goodsName}</h4>
                            <p>原价 ￥${good.goodsPrice}</p>
                            <p>现售
                                <span class="label label-pill label-info">￥${good.goodsPrice - good.goodsDiscount}</span>
                            </p>
                            <p>共售出${good.goodsSales}件</p>
                            <p>
                                <a class="btn btn-primary"
                                   href="${pageContext.request.contextPath}/goods/goodsDetail.action?goods_id=${good.goodsId}">查看详情</a>
                                <!-- <a class="btn btn-primary" href="/eshop8/order/buyGoods?goodsId=46" >立即购买</a>
                                <a class="btn" href="add()">加入购物车</a>  -->
                            </p>
                        </div>
                    </div>
                </div>
            </c:forEach>
        </div>
    </div>
</div>


</body>

<%@include file="/footer.jsp" %>
